﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <include file="../inc/meta.inc" />
    <title>教师信息编辑</title>
</head>

<body>
    <div id="vapp" v-cloak>
        <div class="panel">
            <el-tabs type="border-card" v-model="activeName">
                <el-tab-pane name="general">
                    <span slot="label">
                        <icon style="font-size: 16px;">&#xa043</icon> 基本信息
                    </span>
                </el-tab-pane>
                <el-tab-pane name="contact">
                    <span slot="label">
                        <icon style="font-size: 17px;">&#xe66c</icon> 联系方式
                    </span>
                </el-tab-pane>
                <el-tab-pane name="detail">
                    <span slot="label">
                        <icon style="font-size: 18px;">&#xe669</icon> 详细信息
                    </span>
                </el-tab-pane>
                <el-tab-pane name="intro">
                    <span slot="label">
                        <icon style="font-size: 18px;">&#xe6b0</icon> 个人介绍
                    </span>
                </el-tab-pane>
            </el-tabs>
            <!-- 编辑区域-->
            <el-form ref="entity" :model="entity" :rules="rules" @submit.native.prevent label-width="100px">
                <div v-show="activeName=='general'" remark="基本信息">
                    <el-form-item>
                        <upload-img @change="file=>upfile=file" :data="entity" size="1024" height="100"
                            ext="jpg,png,gif">
                            <template v-if="entity.Th_Photo!='' || upfile!=null">
                                <img v-if="upfile!=null && JSON.stringify(upfile) != '{}'" :src="upfile.base64" />
                                <img v-else :src="entity.Th_Photo" />
                                <el-link type="danger" class="photo-txt"
                                    @click.stop="{upfile=null;entity.Th_Photo='';}">清除图片</el-link>
                            </template>
                            <div class="nophoto" v-else>
                                <img class="photo" v-if="entity.Th_Sex==2" src="/Utilities/images/head2.jpg" />
                                <img class="photo" v-else src="/Utilities/images/head1.jpg" />
                                <el-tooltip content="点击上传图片" placement="right" effect="light">
                                    <span class="photo-txt">上传头像</span>
                                </el-tooltip>
                            </div>
                        </upload-img>
                    </el-form-item>
                    <el-form-item label="账号" v-if="isexist">
                        <span class="el-form-item__label">{{entity.Th_AccName}}</span>
                    </el-form-item>
                    <el-form-item label="账号" prop="Th_AccName" v-else>
                        <el-input v-model="entity.Th_AccName" style="width:200px" :disabled="id!=''"></el-input>
                    </el-form-item>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="姓名" prop="Th_Name">
                                <el-input v-model="entity.Th_Name" clearable @input="pingyin" @blur="pingyin">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8" v-if="titles.length>0">
                            <el-form-item label="" label-width="5px">
                                <el-select v-model="entity.Ths_ID" placeholder="-- 职称 --">
                                    <el-option v-for="(item,i) in titles" :key="item.Ths_ID" :label="item.Ths_Name"
                                        :value="item.Ths_ID">
                                        <span style="float: left;margin-right: 10px;">{{ i+1 }}.&nbsp;</span>
                                        <span style="float: left">{{ item.Ths_Name }}</span>
                                        <el-tag type="info" v-if="!item.Ths_IsUse" style="float: right; ">被禁用</el-tag>
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>

                    <el-form-item label="拼音缩写" prop="Th_Pinyin">
                        <el-input v-model="entity.Th_Pinyin" @focus="pingyin" style="width:100px"></el-input>
                        <span v-show="accPingyin.length>1" class="pingyin">
                            （多音：<span class="py" v-for="(d,i) in accPingyin" @click="entity.Th_Pinyin=d">
                                {{d}} <span v-show='i<accPingyin.length-1'>, </span>
                            </span>）
                    </el-form-item>
                    <el-form-item label="性别" prop="Th_Sex">
                        <el-radio-group v-model="entity.Th_Sex">
                            <el-radio-button label="1">男</el-radio-button>
                            <el-radio-button label="2">女</el-radio-button>
                            <el-radio-button label="0">未知</el-radio-button>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="移动电话" prop="Th_PhoneMobi">
                        <el-input v-model="entity.Th_PhoneMobi" style="width:200px">
                            <icon slot="prefix">&#xe677</icon>
                        </el-input>
                        <el-checkbox v-model="entity.Th_IsOpenMobi">是否公开</el-checkbox>
                    </el-form-item>
                    <el-form-item label="身份证" prop="Th_IDCardNumber">
                        <el-input v-model="entity.Th_IDCardNumber">
                            <icon slot="prefix">&#xe68f</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="状态">
                        <el-checkbox v-model="entity.Th_IsUse">启用</el-checkbox>
                        <el-checkbox v-model="entity.Th_IsPass">审核通过</el-checkbox>
                    </el-form-item>
                </div>
                <div v-show="activeName=='contact'" remark="联系方式">
                    <el-form-item label="固定电话" prop="Th_Phone">
                        <el-input v-model="entity.Th_Phone" style="width:200px">
                            <icon slot="prefix">&#xe66c</icon>
                        </el-input>
                        <el-checkbox v-model="entity.Th_IsOpenPhone">是否公开</el-checkbox>
                    </el-form-item>
                    <el-form-item label="电子邮箱" prop="Th_Email">
                        <el-input v-model="entity.Th_Email">
                            <icon slot="prefix">&#xe76e</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="QQ" prop="Th_QQ">
                        <el-input v-model="entity.Th_QQ" style="width:200px">
                            <icon slot="prefix">&#xe82a</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="微信" prop="Th_Weixin">
                        <el-input v-model="entity.Th_Weixin" style="width:200px">
                            <icon slot="prefix">&#xe730</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="住址" prop="Th_Address">
                        <el-input v-model="entity.Th_Address">
                            <icon slot="prefix">&#xe64f</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="通讯地址" prop="Th_AddrContact">
                        <el-input v-model="entity.Th_AddrContact">
                            <icon slot="prefix">&#xe64c</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="邮编" prop="Th_Zip">
                        <el-input v-model="entity.Th_Zip" style="width:200px">
                            <icon slot="prefix">&#xe751</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="紧急联系人" prop="Th_LinkMan">
                        <el-input v-model="entity.Th_LinkMan">
                            <icon slot="prefix">&#xa043</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="紧急电话" prop="Th_LinkManPhone">
                        <el-input v-model="entity.Th_LinkManPhone" style="width:200px">
                            <icon slot="prefix">&#xa047</icon>
                        </el-input>
                    </el-form-item>
                </div>
                <div v-show="activeName=='detail'" remark="详细信息">
                    <el-form-item label="出生年月">
                        <el-date-picker v-model="entity.Th_Birthday" type="date" placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="学历" prop="Th_Education">
                        <education :value="entity.Th_Education" @change="val=>entity.Th_Education=val"></education>
                    </el-form-item>
                    <el-form-item label="专业" prop="Th_Major">
                        <el-input v-model="entity.Th_Major">
                            <icon slot="prefix">&#xe84b</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="职称" prop="Ths_Name">
                        <el-select v-model="entity.Ths_ID" placeholder="-- 职称 --">
                            <el-option v-for="(item,i) in titles" :key="item.Ths_ID" :label="item.Ths_Name"
                                :value="item.Ths_ID">
                                <span style="float: left;margin-right: 10px;">{{ i+1 }}.&nbsp;</span>
                                <span style="float: left">{{ item.Ths_Name }}</span>
                                <el-tag type="info" v-if="!item.Ths_IsUse" style="float: right; ">被禁用</el-tag>
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="籍贯" prop="Th_Native">
                        <el-input v-model="entity.Th_Native">
                            <icon slot="prefix">&#xa04a</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="工作单位" prop="Th_Job">
                        <el-input v-model="entity.Th_Job">
                            <icon slot="prefix">&#xe6a2</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="民族" prop="Th_Nation">
                        <el-input v-model="entity.Th_Nation" style="width:200px">
                            <icon slot="prefix">&#xa04e</icon>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="签名" prop="Th_Signature">
                        <el-input v-model="entity.Th_Signature" type="textarea" :rows="3"></el-input>
                    </el-form-item>
                </div>
                <div v-show="activeName=='intro'" class="about_editor" remark="个人介绍">
                    <editor :content="entity.Th_Intro" model="mini" ref="editor" upload="Teacher" :dataid="entity.Th_ID"
                        @change="text=>entity.Th_Intro=text">
                    </editor>
                </div>
            </el-form>
        </div>
        <div class="footer">
            <el-button type="primary" native-type="submit" define="enter"  :loading="loading" plain @click="btnEnter('entity')">
                保存
            </el-button>
            <el-button type='close'>
                取消
            </el-button>
        </div>
    </div>
</body>

</html>